package com.xiaomaoguai.eventbus.one;

import org.junit.Test;

import com.google.common.eventbus.EventBus;

/**
 * @Description :
 * @FileName: TestEventBus.java
 * @Author :WeiHui.Zhang
 * @Data : 2015年6月18日 下午2:54:29
 * @Version:V1.00
 */
public class TestEventBus {

	@Test
	public void testReceiveEvent() throws Exception {
		EventBus eventBus = new EventBus("test");

		EventListener listener = new EventListener();
		eventBus.register(listener);

		eventBus.post(new MyEvent("你好"));
		eventBus.post(new MyEvent("谷歌"));
		eventBus.post(new MyEvent("百度"));

		System.out.println("LastMessage:" + listener.getLastMessage());
	}
}
